package com.yogee.topseller.application;

import android.content.Context;
import android.os.Build;
import android.os.StrictMode;
import android.support.multidex.MultiDex;

import com.bugtags.library.Bugtags;
import com.igexin.sdk.PushManager;
import com.umeng.socialize.Config;
import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.UMShareAPI;
import com.yogee.core.base.BaseApplication;
import com.yogee.core.utils.SharedPreferencesUtils;
import com.yogee.topseller.BuildConfig;
import com.yogee.topseller.utils.LogUtils;

/**
 * @auathor ${XiaoJianghong}
 * @date 2017/6/20.
 */

public class TopellerApplication extends BaseApplication {

    @Override
    public void onCreate() {
        super.onCreate();
        //初始化友盟，用于三方登录-微信平台
        Config.DEBUG = false;
        UMShareAPI.get(this);
        PlatformConfig.setWeixin("wxb6242301ba0b55a6", "832f30097c49e9000ef1624085fb5109");
        PlatformConfig.setQQZone("1105338329", "nA0LFef8HHM3pox6");
//        PlatformConfig.setSinaWeibo("3444379865", "0d83f623f83b55d876ee6d9d3e768f79", "http://sns.whalecloud.com");

        PushManager.getInstance().initialize(this, com.yogee.topseller.service.PushService.class);
        PushManager.getInstance().registerPushIntentService(this.getApplicationContext(), com.yogee.topseller.service.GtIntentService.class);

        //在这里初始化
//        Bugtags.start("4079fc41cf30aba80f6632676578e24a", this, Bugtags.BTGInvocationEventBubble);

        if (BuildConfig.LOG_DEBUG) {
            LogUtils.isShowLog = true;
        } else {
            LogUtils.isShowLog = false;
        }

        //解决 Android 7.0 后
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.setVmPolicy(builder.build());
        }

    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
}